import * as api from "../../api/commnet"

export default{
    namespaced: true,
    state:{
        comments:[]
    },
    mutations: {
        // 修改comment
        SET_COMMENT(state,payload){
            state.comments = payload
        } 
    },
    actions: {
        async FETCH_COMMENT(context){
            // 发起获取评论的请求
            let res = await api.getComment();
            console.log(res);
            context.commit("SET_COMMENT",res.data.data)
        }
    }
}